from flask import Flask, request

app = Flask(__name__)

@app.before_request
def before_request():
    print("Before Request:", request.url)

@app.after_request
def after_request(response):
    print("After Request:", response.status_code)
    return response

@app.route('/')
def home():
    return 'Hello, Flask Middleware!'

if __name__ == '__main__':
    app.run(debug=True)